class Point {
  num x = -1, y = -1;

  Point(this.x, this.y);

  Point.origin() {
    x = 0;
    y = 0;
  }

  // 命名构造函数
  Point.formJson({x = -2, y = -2}) {
    this.x = x;
    this.y = y;
  }
}

void main(List<String> args) {
  // 默认坐标
  Point p1 = new Point.origin();
  print(p1.x);
  // 手动设置坐标
  Point p2 = new Point.formJson(x: 8, y: 8);
  print(p2.y);
}
